<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<form class="form-inline" method="GET" action="<?php echo $this->input->server('REQUEST_URI'); ?>" name="queryForm" id="queryForm">
<input type="hidden" name="c" id="c" value="<?php echo $this->input->get('c') ?>">
<input type="hidden" name="m" id="m" value="<?php echo $this->input->get('m') ?>">
  <div class="form-group form-group-sm">
    <label for="year">所属年份：</label>
    <select class="form-control" id="year" name="year">
      <option value="">请选择</option>
    </select>
  </div>
  <div class="form-group form-group-sm">
    <label for="timeUnit">所属双月：</label>
    <select class="form-control" id="timeUnit" name="timeUnit">
      <option value="">请选择</option>
	</select>
  </div>
 <div class="form-group form-group-sm">
  <button type="submit" class="btn btn-primary btn-sm">查询</button>
  </div>
</form>
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<?php foreach ($this->navbar as $k => $v): ?>
  <li role="presentation" style="width: 150px;" <?php if($focusTag == $v['focusTag']){echo 'class="active"';} ?>><a style="width: 150px;" href="<?=$v['url']?>"><?=$v['title']?></a></li>
<?php endforeach ?>
</ul>
<table class="table table-bordered table-condensed text-center" style="width: 400px; line-height: 20px;margin-top: 10px;">
  <tbody>
    <tr style="line-height: 24px;">
      <td class="bg-primary" width="40%">来店量达成标准进度</td>
      <td class="bg-primary" width="60%"><?=$reachStandard?></td>
    </tr>
  </tbody>
</table>
<!-- 表格列表 -->
<div style="margin-top: 10px;">
<table class="table table-bordered table-condensed text-center">
	<thead>
	  <tr class="active">
	    <th class="text-center">名次</th>
	    <th class="text-center">专营店名称</th>
	    <th class="text-center">所属大区</th>
	    <th class="text-center">所属小区</th>
	    <th class="text-center">双月来店量目标</th>
	    <th class="text-center">来店量目标达成率</th>
	  </tr>
	</thead>
	<tbody>
	  <?php foreach ((array)$list as $k => $v) {?>
	  <tr align="center">
	    <td>
      <?php
      if ($focusTag == 'topList_red') {
        echo $k +1;
      }else{
        echo $total - ($limit-$k-1);
      }
      ?>
      </td>
	    <td><?=$v['storeName']?></td>
	    <td><?=$v['region']?></td>
	    <td><?=$v['spsarea']?></td>
	    <td><?=$v['comeStoreTarget']?></td>
      <td><?=$v['comeStoreRate']?>%</td>
	  </tr>
	  <?php } ?>
	</tbody>
</table>
</div>
<!-- 分页 -->
<?=$pager?>
<script type="text/javascript">
  $(function(){
    loadYearList('year',<?=$year ? $year : 0?>);
    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
  });
  $("#year").change(function(){
    loadTimeUnitList('timeUnit',this.value);
  });
</script>
<?php $this->load->view('common/foot');?>